import * as types from './mutation-types'
// import { deepClone } from '@/utils/m7Utils.js'
import Vue from 'vue'

export default {
  [types.SET_EMAIL_STATUS] (state, status) {
    Vue.set(state, 'status', status)
  },
  [types.SET_EMAIL_INFO] (state, data) {
    if (data.data) {
      Vue.set(state, 'status', 'open')
    } else {
      Vue.set(state, 'status', 'close')
    }
    Vue.set(state, 'mailInfo', data)
  },
  [types.DELETE_FIRM_MAIL] (state, data) {
    // if (data.data) {
    //   Vue.set(state, 'status', 'open')
    // } else {
    //   Vue.set(state, 'status', 'close')
    // }
    // Vue.set(state, 'mailInfo', data)
  },
  [types.UPDATE_MAIL_CATEGORY] (state, data) {
    Vue.set(state.mailCategory, 'list', data.list)
  },
  [types.UPDATE_MAIL_CATEGORY_LIST_DISABLE] (state, data) {
    Vue.set(state.mailCategory.list[data.index], 'disable', data.disable)
  }
}
